//
//  PickNumSportItemCellHeader.m
//  PlayBall
//
//  Created by Edward Zhang on 12-5-15.
//  Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
//

#import "JddPickNumSportItemCellHeader.h"

@implementation JddPickNumSportItemCellHeader
GET_INSTANCE_VIEW_IMPLEMENT(JddPickNumSportItemCellHeader)

@synthesize Mnum;
@synthesize delegate;
@synthesize day;
@synthesize Date;
@synthesize statePosition;
@synthesize open;
@synthesize HeadButton;


-(IBAction)HeadClicked:(id)sender{
    self.open = !self.open;
    self.HeadButton.image = self.open?[UIImage imageNamed:@"hemai_hall_down.png"]:[UIImage imageNamed:@"hemai_up.png"];
    [self.delegate performSelector:@selector(sportTeamButtonHeadClicked:) withObject:self.statePosition withObject:nil];
}
- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        // Initialization code 
        self.open = YES;
    }
    return self;
}

// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect
{
    [super drawRect:rect];
    
    CGContextRef context = UIGraphicsGetCurrentContext();
    
    CGContextSetLineWidth(context, .5);
    CGContextSetStrokeColorWithColor(context, [UIColor grayColor].CGColor);
    
    CGContextMoveToPoint(context, 0, 0);
    CGContextAddLineToPoint(context, rect.size.width, 0);
    CGContextClosePath(context);
    CGContextStrokePath(context);

    
    CGContextMoveToPoint(context, 0, rect.size.height);
    CGContextAddLineToPoint(context, rect.size.width, rect.size.height);
    CGContextClosePath(context);
    CGContextStrokePath(context);
}

@end
